#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <string.h>
#include <algorithm>
#include <string>
#include <stdio.h>
using namespace std;
int main()
{
	string tel;
	cin >> tel;
	char arr[12];
	int j = 1;
	arr[0] = tel[0];
	for (int i = 1; i < 11; i++)
	{
		int flag = 1;
		for(int k = 0; k < j; k++)
			if (tel[i] == arr[k])
			{
				flag = 0;
				break;
			}
		if (flag)
			arr[j++] = tel[i];
	}
	sort(arr, arr + j);
	arr[j] = '\0';
	int length = j;
	for (int i = 0; i < length/2; i++)
	{
		char temp = arr[i];
		arr[i] = arr[length - i - 1];
		arr[length - i - 1] = temp;
	}
//	cout << arr << endl;
	int index[12];
	for (int i = 0; i < 11; i++)
	{
		for (int j = 0; j < length; j++)
		{
			if (tel[i] == arr[j])
			{
				index[i] = j;
				break;
			}	
		}
	}
	cout << "int[] arr = new int[]{";
	for (int i = 0; i < length-1; i++)
		cout << arr[i] << ",";
	cout << arr[length - 1] << "};" << endl;
	cout << "int[] index = new int[]{";
	for (int i = 0; i < 10; i++)
		cout << index[i] << ",";
	cout << index[10] << "};";

	system("PAUSE");
	return 0;
}